package com.tuojiahr.common;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;

import com.opensymphony.xwork2.ActionSupport;
import com.tuojiahr.domain.TuoJiaHrUser;

/**
 * 说明：
 *
 * @author wang.haibo
 * @date 2012-11-7 下午7:34:08
 */

public class BaseActionCommon extends ActionSupport implements ServletRequestAware, ServletResponseAware {

	private static final long serialVersionUID = 1L;

	protected HttpServletResponse response;
	protected HttpServletRequest request;  	
	
	/**
	 * 活的当前登录的用户
	 * @return
	 */
	public TuoJiaHrUser getCurrUser() {
		return (TuoJiaHrUser) request.getSession().getAttribute("user");
	}
	
	@Override
	public void setServletResponse(HttpServletResponse response) {
		this.response = response;
	}

	@Override
	public void setServletRequest(HttpServletRequest request) {   
		this.request = request;   
	}

}
